package ex55.mm.flow.impound.quote.exchange.api;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

public class Product {
    private String symbol;
    private String baseAsset;
    private String quoteAsset;
    private Integer depth;

    public String getSymbol() {
        return symbol;
    }

    public Product setSymbol(String symbol) {
        this.symbol = symbol;
        return this;
    }

    public String getBaseAsset() {
        return baseAsset;
    }

    public Product setBaseAsset(String baseAsset) {
        this.baseAsset = baseAsset;
        return this;
    }

    public String getQuoteAsset() {
        return quoteAsset;
    }

    public Product setQuoteAsset(String quoteAsset) {
        this.quoteAsset = quoteAsset;
        return this;
    }

    public Integer getDepth() {
        return depth;
    }

    public Product setDepth(Integer depth) {
        this.depth = depth;
        return this;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("symbol", symbol)
                .append("baseAsset", baseAsset)
                .append("quoteAsset", quoteAsset)
                .append("depth", depth)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (!(o instanceof Product)) return false;

        Product product = (Product) o;

        return new EqualsBuilder()
                .append(symbol, product.symbol)
                .append(baseAsset, product.baseAsset)
                .append(quoteAsset, product.quoteAsset)
                .append(depth, product.depth)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(symbol)
                .append(baseAsset)
                .append(quoteAsset)
                .append(depth)
                .toHashCode();
    }
}